import xml.sax
import os
from com.zjs.crawer.urlhook.hookhandle import HookHandler
from com.zjs.util import util

class BaseUrlHook(object):
    
    
    def run(self):
        parser = xml.sax.make_parser()
        parser.setFeature(xml.sax.handler.feature_namespaces, 0)
        Handler = HookHandler()
        parser.setContentHandler(Handler)
        for parent,dirnames,filenames in os.walk(util.get_config_path()):
            for filename in filenames:
                full_file_path = os.path.join(parent,filename) 
                parser.parse(full_file_path)
        
        
